import time

# 使用语法糖实现装饰器


def decorator(func):
    def wrapper(*args, **kw):
        print(time.time())
        func(*args, **kw)
    return wrapper


@decorator
def f1(func_name):
    print('This is function named '+func_name)


@decorator
def f2(func_name, action):
    print('This is function named '+func_name)


@decorator
def f3(func_name, action, **kw):
    print('This is function named '+func_name)
    print(kw)


f1('test')
f2('test2', 'print')
f3('test3', 'print', a=1, b=2, c='123')
